home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak Vol A-4
/
(Vol A-4) Vol. A4.iso
/
Games
/
maquiagem-lana.swf
/
scripts
/
__Packages
/
mx
/
events
/
UIEventDispatcher.as
< prev
Wrap
Text File
|
2007-11-28
|
3KB
|
101 lines
if(!_global.mx)
{
_global.mx = new Object();
}
§§pop();
if(!_global.mx.events)
{
_global.mx.events = new Object();
}
§§pop();
if(!_global.mx.events.UIEventDispatcher)
{
var _loc0_ = null;
mx.events.UIEventDispatcher = function()
{
super();
};
var _loc1_ = null;
mx.events.UIEventDispatcher.prototype = new mx.events.EventDispatcher();
mx.events.UIEventDispatcher = function()
{
super();
}.addKeyEvents = function addKeyEvents(obj)
{
if(obj.keyHandler == undefined)
{
var _loc0_ = null;
var _loc1_ = obj.keyHandler = new Object();
_loc1_.owner = obj;
_loc1_.onKeyDown = mx.events.UIEventDispatcher._fEventDispatcher.onKeyDown;
_loc1_.onKeyUp = mx.events.UIEventDispatcher._fEventDispatcher.onKeyUp;
}
Key.addListener(obj.keyHandler);
};
mx.events.UIEventDispatcher = function()
{
super();
}.removeKeyEvents = function removeKeyEvents(obj)
{
Key.removeListener(obj.keyHandler);
};
mx.events.UIEventDispatcher = function()
{
super();
}.addLoadEvents = function addLoadEvents(obj)
{
if(obj.onLoad == undefined)
{
obj.onLoad = mx.events.UIEventDispatcher._fEventDispatcher.onLoad;
obj.onUnload = mx.events.UIEventDispatcher._fEventDispatcher.onUnload;
if(obj.getBytesTotal() == obj.getBytesLoaded())
{
obj.doLater(obj,"onLoad");
}
}
};
mx.events.UIEventDispatcher = function()
{
super();
}.removeLoadEvents = function removeLoadEvents(obj)
{
delete obj.onLoad;
delete obj.onUnload;
};
mx.events.UIEventDispatcher = function()
{
super();
}.initialize = function initialize(obj)
{
if(mx.events.UIEventDispatcher._fEventDispatcher == undefined)
{
mx.events.UIEventDispatcher._fEventDispatcher = new mx.events.UIEventDispatcher();
}
obj.addEventListener = mx.events.UIEventDispatcher._fEventDispatcher.__addEventListener;
obj.__origAddEventListener = mx.events.UIEventDispatcher._fEventDispatcher.addEventListener;
obj.removeEventListener = mx.events.UIEventDispatcher._fEventDispatcher.removeEventListener;
obj.dispatchEvent = mx.events.UIEventDispatcher._fEventDispatcher.dispatchEvent;
obj.dispatchQueue = mx.events.UIEventDispatcher._fEventDispatcher.dispatchQueue;
};
mx.events.UIEventDispatcher.prototype = new mx.events.EventDispatcher().dispatchEvent = function dispatchEvent(eventObj)
{
if(eventObj.target == undefined)
{
eventObj.target = this;
}
this[eventObj.type + "Handler"](eventObj);
this.dispatchQueue(mx.events.EventDispatcher,eventObj);
this.dispatchQueue(this,eventObj);
};
mx.events.UIEventDispatcher.prototype = new mx.events.EventDispatcher().onKeyDown = function onKeyDown(Void)
{
this.owner.dispatchEvent({type:"keyDown",code:Key.getCode(),ascii:Key.getAscii(),shiftKey:Key.isDown(16),ctrlKey:Key.isDown(17)});
};
§§push(mx.events.UIEventDispatcher.prototype = new mx.events.EventDispatcher());
§§push("onKeyUp");
}
else
{
§§pop();
}